<%@ Page Language="VB" Description="Component Test Program" Debug="True" %>
<%@ Import Namespace="BusObjectCS" %>
<%@ Import Namespace="BusObjectVB" %>
<%@ Import Namespace="System.Data" %>

<html>
<script runat=server>
sub Page_Load(sender as Object, evtArgs as EventArgs)
	dim dsn as String = "server=localhost;uid=sa;pwd=;database=IBuyAdventure"

'	dim objProducts = new BusObjectCS.IBAProducts()
	dim objProducts = new BusObjectVB.IBAProducts()
	

	objProducts.DatabaseConnection = dsn

	dim products as DataSet = objProducts.GetProducts(Request.Params("PID"))

	prodGrid.DataSource = products
	prodGrid.DataBind()

	avgPrice.Text = objProducts.AveragePrice(Request.Params("PID")).ToString()
end sub

</script>

<body>

<h2>Average price for products in this category = <asp:Label runat="server" id=avgPrice /></h2>

  <h3>List of Products</font></h3>

<asp:DataGrid id="prodGrid" runat="server" ShowHeader="False">
</asp:DataGrid>

</body>
</html>
